<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta charset='UTF-8'>
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>Help Center</title>
    <style type="text/css">body{background-color:#f2f3f3}p{margin-left:20px}.button-div{width:100%;padding:10px;box-sizing:border-box;display:flex;display:-webkit-flex;flex-direction:column;align-items:stretch;justify-content:center}.button{margin-top:20px;height:48px;line-height:48px;cursor:pointer;-webkit-tap-highlight-color:transparent;text-decoration:none}.button-text{display:block;padding:0 6px;border-radius:3px;background:#e31436;color:#fff;font-size:20px;line-height:48px;text-align:center}.button-text:active{background:#ee5a5b}</style>

    <script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.inc.min.js"></script>
    <script>

        function pay(){
            var orderId = getQueryVariable("orderId");
              console.log(orderId);
         ap.tradePay({
                  tradeNO: orderId
                }, function(res){
                    ap.alert(res.resultCode);
                });

        }
        function getQueryVariable(variable){
           var query = window.location.search.substring(1);
           var vars = query.split("&");
           for (var i=0;i<vars.length;i++) {
                var pair = vars[i].split("=");
                if(pair[0] == variable){return pair[1];}
           }
           return(false);
        }
</script>
</head>
<body>
<div class='button-div'>
    <a  id="yhpl" class='button' onclick="javascript: pay()">
    <span class="button-text">支付</span>
    </a>
</div>
</body>
</html>



